package L617;

import java.util.Scanner;

/**
 * @program: javase
 * @description:
 * @author: luolidong
 * @create: 2021-06-17 20:00
 * @version: 1.0
 */
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            int n=sc.nextInt();
            int start=sc.nextInt();
            int[] m=new int[n];
            for(int i=0;i<n;i++){
                m[i]=sc.nextInt();
                if(m[i]<=start){
                    start+=m[i];
                }else{
                    start+=getGreatestCommonDivisor(m[i],start);
                }
            }
            System.out.println(start);
        }
        sc.close();
    }
    public static int getGreatestCommonDivisor(int a,int b){
//
        int big=Math.max(a,b);
        int small=Math.min(a,b);
        if(big%small==0){
            return small;
        }else {
            return getGreatestCommonDivisor(big%small,small);
        }

    }
}

